package com.amit.hibernate;

import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.IndexColumn;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name="expcandidates123")
@PrimaryKeyJoinColumn(name="cid")
public class ExpCandidate extends Candidate {
	
	int yoe;
	@CollectionOfElements
	@JoinTable(name="skills123",
			joinColumns=@JoinColumn(name="cid"))
			@Column(name="skillName")
			@LazyCollection(LazyCollectionOption.FALSE)
	Set<String> skills;
	@CollectionOfElements
	@JoinTable(name="companies123",
			joinColumns=@JoinColumn(name="cid"))
			@IndexColumn(name="idx")
	List<String> companies;
	double ctc;
	
	public ExpCandidate() {
		
	}
	public ExpCandidate(String fname, String lname, List<String> emails,
			String qualification, String dob,int yoe,Set<String> skills,List<String> companies,double ctc) {
		super(fname, lname, emails, qualification, dob);
		
		this.yoe=yoe;
		this.skills=skills;
		this.companies=companies;
		this.ctc=ctc;
		
	}
	public int getYoe() {
		return yoe;
	}
	public void setYoe(int yoe) {
		this.yoe = yoe;
	}
	public Set<String> getSkills() {
		return skills;
	}
	public void setSkills(Set<String> skills) {
		this.skills = skills;
	}
	public List<String> getCompanies() {
		return companies;
	}
	public void setCompanies(List<String> companies) {
		this.companies = companies;
	}
	public double getCtc() {
		return ctc;
	}
	public void setCtc(double ctc) {
		this.ctc = ctc;
	}
	
	
	

	
	
	

}
